package cn.tedu.coolshark.controller;


import cn.tedu.coolshark.mapper.CategoryMapper;
import cn.tedu.coolshark.pojo.entity.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CatagoryController {

    @Autowired(required = false)
    private CategoryMapper categoryMapper;

    @RequestMapping("/categoryArr/select")
    public List<Category> select(){
        return categoryMapper.select();
    }

    @RequestMapping("/category/delete")
    public void deleteById(int id){
        categoryMapper.deleteById(id);
    }

}
